﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decorator
{
    internal class StringDisplay : Display
    {
        private readonly string value;
        public StringDisplay(string value)
        {
            this.value = value;
        }

        public override int GetColumns()
        {
            return Encoding.UTF8.GetBytes(this.value).Length; 
        }

        public override int GetRows()
        {
            return 1;
        }

        public override string GetRowText(int row)
        {
            if (row != 0) 
            {
                return null;
            }

            return this.value;
        }
    }
}
